<?php

namespace common\repositories\myhtsq;

use common\repositories\BaseRepository;
use common\entities\myhtsq\ContractBusinessTypeEntity;

class ContractBusinessTypeRepository extends BaseRepository
{
    public static function getBusinessTypeById($business_type_name = '')
    {
        return ContractBusinessTypeEntity::find()->select('business_type_name')->where(['business_type_id' => $business_type_name])->asArray()->one();
    }

    public static function getBusinessTypeByName($business_type)
    {
        return ContractBusinessTypeEntity::find()->where(['business_type_name' => $business_type])->asArray()->one();
    }

    public static function getBusinessTypeAll(){
        return ContractBusinessTypeEntity::find()->where("business_type_id !='f8592797-54ca-11e7-9f96-000c29310f8b'")->all();
    }
}